﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Skyhook.Sprites
{
    internal static class SpriteProjection
    {
        static Matrix OrthohraphicProjection;
        static int ViewWidth = 0;
        static int ViewHeight = 0;
        
        private static void SetupProjectionMatrix()
        {
            OrthohraphicProjection = Matrix.CreateTranslation(-0.5f, -0.5f, 0);
            OrthohraphicProjection *= Matrix.CreateOrthographicOffCenter(0, ViewWidth, ViewHeight, 0, -100, 1000);
        }

        static SpriteProjection()
        {
            SetupProjectionMatrix();
        }

        public static void SetViewSize(int width,int height)
        {
            ViewWidth = width;
            ViewHeight = height;
            SetupProjectionMatrix();
        }

        public static Matrix OrthohraphicProjectionMatrix
        {
            get
            {
                return OrthohraphicProjection;
            }
        }
    }
}
